from paddleocr import PaddleOCR


image_path = r'.\resources\1111.png'

# """ OCR """
ocr = PaddleOCR(use_gpu=True, lang='ch')
res = ocr.ocr(image_path, cls=True)
# 提取文本
texts = []
for line in res[0]:
    text = line[1][0]
    texts.append(text)

# 将提取的文本合并为一个字符串
cleaned_text = '\n'.join(texts)

# 打印清洗后的文本
print(cleaned_text)
